package com.ws;

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

public class TestClient {
    public static void main(String[] args) {
        JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean();
        jaxWsProxyFactoryBean.setServiceClass(DemoService.class);
        jaxWsProxyFactoryBean.setAddress("http://localhost:8080/ws/DemoService");
        DemoService demoService = (DemoService) jaxWsProxyFactoryBean.create();
        String result = demoService.sayHello("CXF");
        System.out.println(result);
    }
}